Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add queries for tss funds migrator info #2372

Merged
merged 6 commits into from
Jun 26, 2024

Conversation

kingpinXD
Copy link
Contributor

@kingpinXD kingpinXD commented Jun 21, 2024

Description

Closes #2371

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Checklist:

  • I have added unit tests that prove my fix feature works

Summary by CodeRabbit

  • New Features

    • Introduced CLI commands list-tss-funds-migrator and show-tss-funds-migrator for querying TSS funds migrator information.
    • Added two new API endpoints for querying TSS fund migrator information.
  • Documentation

    • Updated CLI documentation to include details for the new commands list-tss-funds-migrator and show-tss-funds-migrator.
    • Added new CLI documentation files detailing the usage and options for the new TSS funds migrator commands.
  • Tests

    • Added test functions for retrieving and handling TSS funds migrator information.
  • Chores

    • Minor parameter renaming for clarity in internal function definitions.

Copy link
Contributor

coderabbitai bot commented Jun 21, 2024

Important

Review skipped

Review was skipped due to path filters

Files ignored due to path filters (1)
  • changelog.md is excluded by none and included by none

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update introduces new functionality that enables querying TSS (Threshold Signature Scheme) fund migration information in the ZetaChain network. Specifically, new commands and API endpoints are added to retrieve details and lists of TSS funds migrators, enhancing the observability and management of fund migrations. Additionally, various CLI, proto definitions, and TypeScript declarations have been updated to support these features without altering any existing public entity declarations.

Changes

File Path Change Summary
changelog.md Added summary of the new TSS fund migration query functionality.
docs/cli/zetacored/... Documented new CLI commands (list-tss-funds-migrator, show-tss-funds-migrator) and their options for TSS funds migrations.
docs/openapi/... Added new OpenAPI endpoints for querying TSS fund migrator information and updated response schemas.
proto/zetachain/... Introduced new RPCs and messages in Protobuf for querying TSS fund migrator information.
typescript/zetachain/... Added new TypeScript classes to handle TSS fund migrator query requests and responses.
x/observer/client/cli/query.go Added new CLI commands CmdGetAllTssFundsMigrator() and CmdGetTssFundsMigrator() to the query command.
cmd/zetaclientd/gen_pre_params.go Minor change to handle an unused cmd parameter by replacing it with an underscore.
x/observer/client/cli/query_tss_fund_migrator.go Added CLI commands to show and list TSS funds migrators details.
x/observer/keeper/grpc_query_tss_funds_migrator_info.go Implemented functions for querying specific and all TSS fund migrator info within the keeper package.
x/observer/keeper/grpc_query_tss_funds_migrator_test.go Added tests for TSS fund migrator info queries, covering success and error scenarios.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant API
    participant Keeper

    User->>CLI: Execute list-tss-funds-migrator command
    CLI->>API: Send request to list TSS funds migrators
    API->>Keeper: Query all TSS funds migrator info
    Keeper-->>API: Return all TSS funds migrator info
    API-->>CLI: Send response with list of TSS funds migrator info
    CLI-->>User: Display list of TSS funds migrator info

    User->>CLI: Execute show-tss-funds-migrator command with chain ID
    CLI->>API: Send request to show TSS funds migrator for the given chain ID
    API->>Keeper: Query TSS funds migrator info for specific chain
    Keeper-->>API: Return TSS funds migrator info for the given chain ID
    API-->>CLI: Send response with TSS funds migrator info
    CLI-->>User: Display TSS funds migrator info
Loading

Poem

In the land where data flows free and wide,
Zeta brought queries for funds we glide.
With new commands to show and list,
TSS migrators, none will be missed.
From CLI to APIs, the changes whisper,
Bringing clarity, like morning's glimmer.
Traverse the blockchain, let insights bloom,
With Zeta’s tools, there's always room! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jun 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.45%. Comparing base (a97bf13) to head (39e6f5e).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2372      +/-   ##
===========================================
+ Coverage    69.42%   69.45%   +0.02%     
===========================================
  Files          306      307       +1     
  Lines        19047    19065      +18     
===========================================
+ Hits         13224    13242      +18     
  Misses        5167     5167              
  Partials       656      656              
Files Coverage Δ
...erver/keeper/grpc_query_tss_funds_migrator_info.go 100.00% <100.00%> (ø)

@kingpinXD kingpinXD marked this pull request as ready for review June 21, 2024 21:12
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Outside diff range and nitpick comments (10)
docs/cli/zetacored/zetacored_query_observer_list-tss-funds-migrator.md (3)

5-5: Specify language for fenced code blocks

To improve the readability and formatting in Markdown viewers and editors, specify the language for each fenced code block.

- ```
+ ```bash

Apply this change to all instances where the fenced code block language is missing.

Also applies to: 11-11, 28-28

Tools
Markdownlint

5-5: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


39-39: Remove hard tabs from the Markdown file

Using spaces instead of tabs will ensure consistent formatting across different editors and platforms.

- * [zetacored query observer](zetacored_query_observer.md)	 - Querying commands for the observer module
+ * [zetacored query observer](zetacored_query_observer.md)  - Querying commands for the observer module
Tools
Markdownlint

39-39: Column: 58 (MD010, no-hard-tabs)
Hard tabs


Line range hint 41-41: Avoid multiple consecutive blank lines

Reducing multiple blank lines to a single blank line helps in maintaining a clean and professional appearance of the document.

- 
-
+ 
Tools
Markdownlint

9-9: Expected: h2; Actual: h3 (MD001, heading-increment)
Heading levels should only increment by one level at a time


39-39: Column: 58 (MD010, no-hard-tabs)
Hard tabs


5-5: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


11-11: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


28-28: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified

docs/cli/zetacored/zetacored_query_observer_show-tss-funds-migrator.md (3)

5-5: Specify language for fenced code blocks

To improve the readability and formatting in Markdown viewers and editors, specify the language for each fenced code block.

- ```
+ ```bash

Apply this change to all instances where the fenced code block language is missing.

Also applies to: 11-11, 28-28

Tools
Markdownlint

5-5: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


39-39: Remove hard tabs from the Markdown file

Using spaces instead of tabs will ensure consistent formatting across different editors and platforms.

- * [zetacored query observer](zetacored_query_observer.md)	 - Querying commands for the observer module
+ * [zetacored query observer](zetacored_query_observer.md)  - Querying commands for the observer module
Tools
Markdownlint

39-39: Column: 58 (MD010, no-hard-tabs)
Hard tabs


Line range hint 41-41: Avoid multiple consecutive blank lines

Reducing multiple blank lines to a single blank line helps in maintaining a clean and professional appearance of the document.

- 
-
+ 
Tools
Markdownlint

9-9: Expected: h2; Actual: h3 (MD001, heading-increment)
Heading levels should only increment by one level at a time


39-39: Column: 58 (MD010, no-hard-tabs)
Hard tabs


5-5: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


11-11: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


28-28: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified

docs/cli/zetacored/zetacored_query_observer.md (4)

Line range hint 9-9: Correct the heading level for consistency

The heading level here should increment by one level at a time. Consider changing from h3 to h2 for better document structure and readability.

- ### Options
+ ## Options
Tools
Markdownlint

36-36: Column: 94 (MD010, no-hard-tabs)
Hard tabs


37-37: Column: 94 (MD010, no-hard-tabs)
Hard tabs


38-38: Column: 98 (MD010, no-hard-tabs)
Hard tabs


39-39: Column: 106 (MD010, no-hard-tabs)
Hard tabs


40-40: Column: 92 (MD010, no-hard-tabs)
Hard tabs


41-41: Column: 82 (MD010, no-hard-tabs)
Hard tabs


42-42: Column: 80 (MD010, no-hard-tabs)
Hard tabs


Line range hint 5-5: Specify language for fenced code blocks

To improve the readability and formatting in Markdown viewers and editors, specify the language for each fenced code block.

- ```
+ ```bash

Apply this change to all instances where the fenced code block language is missing.

Also applies to: 11-11, 17-17

Tools
Markdownlint

36-36: Column: 94 (MD010, no-hard-tabs)
Hard tabs


37-37: Column: 94 (MD010, no-hard-tabs)
Hard tabs


38-38: Column: 98 (MD010, no-hard-tabs)
Hard tabs


39-39: Column: 106 (MD010, no-hard-tabs)
Hard tabs


40-40: Column: 92 (MD010, no-hard-tabs)
Hard tabs


41-41: Column: 82 (MD010, no-hard-tabs)
Hard tabs


42-42: Column: 80 (MD010, no-hard-tabs)
Hard tabs


Line range hint 28-50: Remove hard tabs from the Markdown file

Using spaces instead of tabs will ensure consistent formatting across different editors and platforms.

- * [zetacored query observer list-tss-funds-migrator](zetacored_query_observer_list-tss-funds-migrator.md)	 - list all tss funds migrators
+ * [zetacored query observer list-tss-funds-migrator](zetacored_query_observer_list-tss-funds-migrator.md)  - list all tss funds migrators

Apply this change to all instances where hard tabs are used.

Tools
Markdownlint

36-36: Column: 94 (MD010, no-hard-tabs)
Hard tabs


37-37: Column: 94 (MD010, no-hard-tabs)
Hard tabs


38-38: Column: 98 (MD010, no-hard-tabs)
Hard tabs


39-39: Column: 106 (MD010, no-hard-tabs)
Hard tabs


40-40: Column: 92 (MD010, no-hard-tabs)
Hard tabs


41-41: Column: 82 (MD010, no-hard-tabs)
Hard tabs


42-42: Column: 80 (MD010, no-hard-tabs)
Hard tabs


Line range hint 52-52: Avoid multiple consecutive blank lines

Reducing multiple blank lines to a single blank line helps in maintaining a clean and professional appearance of the document.

- 
-
+ 
Tools
Markdownlint

36-36: Column: 94 (MD010, no-hard-tabs)
Hard tabs


37-37: Column: 94 (MD010, no-hard-tabs)
Hard tabs


38-38: Column: 98 (MD010, no-hard-tabs)
Hard tabs


39-39: Column: 106 (MD010, no-hard-tabs)
Hard tabs


40-40: Column: 92 (MD010, no-hard-tabs)
Hard tabs


41-41: Column: 82 (MD010, no-hard-tabs)
Hard tabs


42-42: Column: 80 (MD010, no-hard-tabs)
Hard tabs

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bae5b6a and 635e110.

Files ignored due to path filters (2)
  • x/observer/types/query.pb.go is excluded by !**/*.pb.go
  • x/observer/types/query.pb.gw.go is excluded by !**/*.pb.gw.go
Files selected for processing (11)
  • changelog.md (1 hunks)
  • docs/cli/zetacored/zetacored_query_observer.md (2 hunks)
  • docs/cli/zetacored/zetacored_query_observer_list-tss-funds-migrator.md (1 hunks)
  • docs/cli/zetacored/zetacored_query_observer_show-tss-funds-migrator.md (1 hunks)
  • docs/openapi/openapi.swagger.yaml (4 hunks)
  • proto/zetachain/zetacore/observer/query.proto (2 hunks)
  • typescript/zetachain/zetacore/observer/query_pb.d.ts (2 hunks)
  • x/observer/client/cli/query.go (1 hunks)
  • x/observer/client/cli/query_tss_fund_migrator.go (1 hunks)
  • x/observer/keeper/grpc_query_tss_funds_migrator_info.go (1 hunks)
  • x/observer/keeper/grpc_query_tss_funds_migrator_test.go (1 hunks)
Additional context used
GitHub Check: lint
x/observer/client/cli/query_tss_fund_migrator.go

[warning] 23-23:
var-naming: var chainId should be chainID (revive)

Markdownlint
docs/cli/zetacored/zetacored_query_observer_list-tss-funds-migrator.md

9-9: Expected: h2; Actual: h3 (MD001, heading-increment)
Heading levels should only increment by one level at a time


39-39: Column: 58 (MD010, no-hard-tabs)
Hard tabs


41-41: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines


5-5: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


11-11: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


28-28: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified

docs/cli/zetacored/zetacored_query_observer_show-tss-funds-migrator.md

9-9: Expected: h2; Actual: h3 (MD001, heading-increment)
Heading levels should only increment by one level at a time


39-39: Column: 58 (MD010, no-hard-tabs)
Hard tabs


41-41: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines


5-5: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


11-11: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


28-28: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified

docs/cli/zetacored/zetacored_query_observer.md

9-9: Expected: h2; Actual: h3 (MD001, heading-increment)
Heading levels should only increment by one level at a time


28-28: Column: 40 (MD010, no-hard-tabs)
Hard tabs


29-29: Column: 112 (MD010, no-hard-tabs)
Hard tabs


30-30: Column: 90 (MD010, no-hard-tabs)
Hard tabs


31-31: Column: 80 (MD010, no-hard-tabs)
Hard tabs


32-32: Column: 94 (MD010, no-hard-tabs)
Hard tabs


33-33: Column: 94 (MD010, no-hard-tabs)
Hard tabs


34-34: Column: 94 (MD010, no-hard-tabs)
Hard tabs


35-35: Column: 82 (MD010, no-hard-tabs)
Hard tabs


36-36: Column: 94 (MD010, no-hard-tabs)
Hard tabs


37-37: Column: 94 (MD010, no-hard-tabs)
Hard tabs


38-38: Column: 98 (MD010, no-hard-tabs)
Hard tabs


39-39: Column: 106 (MD010, no-hard-tabs)
Hard tabs


40-40: Column: 92 (MD010, no-hard-tabs)
Hard tabs


41-41: Column: 82 (MD010, no-hard-tabs)
Hard tabs


42-42: Column: 80 (MD010, no-hard-tabs)
Hard tabs


43-43: Column: 94 (MD010, no-hard-tabs)
Hard tabs


44-44: Column: 94 (MD010, no-hard-tabs)
Hard tabs


45-45: Column: 102 (MD010, no-hard-tabs)
Hard tabs


46-46: Column: 82 (MD010, no-hard-tabs)
Hard tabs


47-47: Column: 94 (MD010, no-hard-tabs)
Hard tabs


48-48: Column: 98 (MD010, no-hard-tabs)
Hard tabs


49-49: Column: 76 (MD010, no-hard-tabs)
Hard tabs


50-50: Column: 106 (MD010, no-hard-tabs)
Hard tabs


52-52: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines


5-5: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


11-11: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


17-17: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified

changelog.md

223-223: Expected: asterisk; Actual: dash (MD004, ul-style)
Unordered list style


474-474: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


514-514: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces


218-218: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines


240-240: null (MD024, no-duplicate-heading)
Multiple headings with the same content


287-287: null (MD024, no-duplicate-heading)
Multiple headings with the same content


343-343: null (MD024, no-duplicate-heading)
Multiple headings with the same content


219-219: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines


359-359: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines


364-364: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines


368-368: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines


373-373: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines


242-242: null (MD034, no-bare-urls)
Bare URL used


532-532: null (MD047, single-trailing-newline)
Files should end with a single newline character

LanguageTool
changelog.md

[grammar] ~65-~65: It appears that a hyphen is missing in the plural noun “to-dos”? (TO_DO_HYPHEN)
Context: ...ub.com//pull/2329) - fix TODOs in rpc unit tests * [2342](https://gith...


[misspelling] ~80-~80: This word is normally spelled with a hyphen. (EN_COMPOUNDS_CHERRY_PICKED)
Context: ...//pull/2327) - partially cherry picked the fix to Bitcoin outbound dust amount...


[uncategorized] ~89-~89: When ‘mac-specific’ is used as a modifier, it is usually spelled with a hyphen. (SPECIFIC_HYPHEN)
Context: ...me which should be the version. Removed mac specific build as the arm build should handle th...


[style] ~90-~90: Consider changing the order of words to improve your wording. (TO_NOT_VB)
Context: ...ocker build step for non release builds to not overwrite the github tag * [2192](https...


[grammar] ~106-~106: Did you mean “sending”? Or maybe you should add a pronoun? In active voice, ‘require’ + ‘to’ takes an object, usually a pronoun. (ALLOW_TO)
Context: ... * Updating admin policies now requires to send a governance proposal executing the `Up...


[uncategorized] ~178-~178: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short). (COMMA_COMPOUND_SENTENCE_2)
Context: ...n/node/pull/1899) - add empty test files so packages are included in coverage * [19...


[uncategorized] ~229-~229: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ... Breaking Changes * zetaclientd start: now requires 2 inputs from stdin: hotke...


[grammar] ~266-~266: Did you mean “running”? Or maybe you should add a pronoun? In active voice, ‘allow’ + ‘to’ takes an object, usually a pronoun. (ALLOW_TO)
Context: ....com//pull/1584) - allow to run E2E tests on any networks * [1746](http...


[grammar] ~275-~275: The operating system from Apple is written “macOS”. (MAC_OS)
Context: ...nto dockerhub on release for ubuntu and macos * Adjusted the pipeline for building an...


[grammar] ~276-~276: The operating system from Apple is written “macOS”. (MAC_OS)
Context: ... building and pushing docker images for MacOS to install and run docker * Added docke...


[uncategorized] ~282-~282: When ‘start-up’ is used as a noun or modifier, it needs to be hyphenated. (VERB_NOUN_CONFUSION)
Context: ...he new docker image that facilitate the start up automation * Adjusted the docker pipeli...


[grammar] ~303-~303: Before the countable noun ‘to’ an article or a possessive pronoun is necessary. (IN_NN_CC_VBG)
Context: ...ssues/1610) - add pending outtx hash to tracker after monitoring for 10 minutes * [1656...


[uncategorized] ~369-~369: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...arams described below. * GetCoreParams: Renamed into GetChainParams. `/zeta-c...


[uncategorized] ~453-~453: Possible wrong verb form detected. Did you mean “been” or “being”? (BE_WITH_WRONG_VERB_FORM)
Context: ... update an observer, this can be either be run a tombstoned observer/validator or ...


[grammar] ~493-~493: Did you mean “testing”? Or maybe you should add a pronoun? In active voice, ‘allow’ + ‘to’ takes an object, usually a pronoun. (ALLOW_TO)
Context: ...pgrade name, and allow download. allows to test release * [1153](https://github.com/zet...


[misspelling] ~501-~501: This word is normally spelled with a hyphen. (EN_COMPOUNDS_CHERRY_PICK)
Context: ...github.com//pull/1235) - cherry pick all hotfix from v10.0.x (zero-amount, p...

Additional comments not posted (16)
x/observer/client/cli/query.go (1)

44-45: Ensure correct integration of new CLI commands.

The addition of CmdGetAllTssFundsMigrator() and CmdGetTssFundsMigrator() to the list of commands is correctly implemented. Ensure these functions are properly defined and handle their respective functionalities as expected.

x/observer/keeper/grpc_query_tss_funds_migrator_info.go (2)

14-36: Review of TssFundsMigratorInfo function.

This function is well-implemented with proper checks for null requests and invalid chain IDs. The error messages are clear and should help in debugging. Ensure that the function GetFundMigrator is robust and handles edge cases effectively.


38-51: Review of TssFundsMigratorInfoAll function.

The function handles the request appropriately, checking for null requests and retrieving all TSS funds migrators correctly. The implementation is straightforward and follows best practices for error handling and data retrieval.

x/observer/client/cli/query_tss_fund_migrator.go (1)

46-70: Review of CmdGetAllTssFundsMigrator function.

This function is correctly implemented for listing all TSS funds migrators. It uses pagination flags and query flags appropriately, ensuring a flexible and user-friendly command.

x/observer/keeper/grpc_query_tss_funds_migrator_test.go (2)

15-64: Comprehensive test coverage for TSS funds migrator

The tests are well-structured and provide comprehensive coverage for various scenarios including error cases and successful data retrieval. This is crucial for ensuring the robustness of the TSS funds migrator functionality.


66-104: Comprehensive test coverage for TSS funds migrator (all)

The tests for querying all TSS funds migrators are thorough and cover scenarios from error handling to successful data retrieval, ensuring the functionality works as expected across different conditions.

proto/zetachain/zetacore/observer/query.proto (7)

19-19: Import statement is correctly added.

The import of tss_funds_migrator.proto is necessary for the new RPC methods and message types related to TSS funds migrators.


154-158: New RPC method TssFundsMigratorInfo is well-defined.

The method is correctly set up with an appropriate HTTP GET path and is designed to return specific TSS funds migrator information based on the chain ID provided in the request.


160-165: New RPC method TssFundsMigratorInfoAll is correctly implemented.

This method provides a way to retrieve information about all TSS funds migrators, correctly using a RESTful GET path and returning the expected list of migrators.


168-168: Message definition for QueryTssFundsMigratorInfoAllRequest is appropriate.

This message serves as a request type for querying all TSS funds migrators, correctly designed as an empty message for methods that do not require specific input parameters.


170-173: Message definition for QueryTssFundsMigratorInfoAllResponse is well-structured.

This response message is designed to handle multiple TSS funds migrators, using a repeated field with a non-nullable constraint to ensure data integrity.


175-175: Message definition for QueryTssFundsMigratorInfoRequest is correctly designed.

This request message is appropriately structured with a chain_id field, necessary for querying specific TSS funds migrator information.


176-177: Message definition for QueryTssFundsMigratorInfoResponse ensures data integrity.

This response message is well-designed, incorporating a non-nullable TssFundMigratorInfo field to guarantee that the response always contains valid migrator information.

changelog.md (1)

31-31: Change log entry for PR 2372 is correct and well-documented.

The entry accurately reflects the addition of new queries for TSS fund migration information as described in the PR. Good job on maintaining the consistency and clarity in the changelog.

typescript/zetachain/zetacore/observer/query_pb.d.ts (2)

25-39: New class for querying all TSS funds migrator info.

The QueryTssFundsMigratorInfoAllRequest class is correctly defined according to the protobuf specification. It includes methods for serialization and comparison, which are standard for data transfer objects in TypeScript.


92-110: Ensure correct handling of optional fields in response.

The QueryTssFundsMigratorInfoResponse class includes an optional tssFundsMigrator field. It's important to confirm that all calling code correctly handles cases where this field might be null or undefined.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 635e110 and cf6696e.

Files selected for processing (2)
  • cmd/zetaclientd/gen_pre_params.go (1 hunks)
  • x/observer/client/cli/query_tss_fund_migrator.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • cmd/zetaclientd/gen_pre_params.go
Files skipped from review as they are similar to previous changes (1)
  • x/observer/client/cli/query_tss_fund_migrator.go

Copy link
Contributor

@skosito skosito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one small comment

@kingpinXD kingpinXD requested review from lumtis and skosito June 24, 2024 13:22
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kingpinXD ready for rereview? I may see #2372 (comment) is not fixed

@kingpinXD kingpinXD requested a review from lumtis June 24, 2024 22:09
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between cf6696e and 3ce9687.

Files ignored due to path filters (2)
  • x/observer/types/query.pb.go is excluded by !**/*.pb.go
  • x/observer/types/query.pb.gw.go is excluded by !**/*.pb.gw.go
Files selected for processing (2)
  • docs/openapi/openapi.swagger.yaml (3 hunks)
  • proto/zetachain/zetacore/observer/query.proto (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • docs/openapi/openapi.swagger.yaml
  • proto/zetachain/zetacore/observer/query.proto

@kingpinXD kingpinXD requested a review from lumtis June 25, 2024 20:58
@kingpinXD kingpinXD merged commit f2ac8f6 into develop Jun 26, 2024
19 checks passed
@kingpinXD kingpinXD deleted the query-tss-funds-migrator branch June 26, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add query for tss fund migrator
4 participants